home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / SHARE / prog / POVRAY / E-P-O.ZIP / OVEN.INC < prev    next >
Encoding:
Text File  |  1996-10-31  |  6.7 KB  |  192 lines

  1.  
  2. //------------------------------------------------------------------->
  3. //
  4. // oven.inc
  5. //
  6. // "Easy POV Oven"
  7. //
  8. // Written By: Paul T. Dawson
  9. //             ptdawson@voicenet.com
  10. //             http://www.voicenet.com/~ptdawson
  11. //
  12. // All code and techniques are PUBLIC DOMAIN - have fun with it!
  13. //
  14. //------------------------------------------------------------------->
  15. //
  16. // This file builds the "Oven" object.
  17.  
  18. //------------------------------------------------------------------->
  19. //
  20. // Spiral texture for the burners.
  21.  
  22.         #declare T_Spiral_Burner = texture {
  23.  
  24.                 pigment { spiral1 1
  25.  
  26.                 color_map { [ 0.0, 0.3 color OrangeRed color OrangeRed ]
  27.                             [ 0.3, 0.4 color OrangeRed color Gray20    ]
  28.                             [ 0.4, 1.0 color Gray20    color Gray20    ] }
  29.  
  30.                 } // End of pigment.
  31.  
  32.                 scale < 0.5, 0.5, 0.5 >
  33.                 rotate x * 90
  34.  
  35.                 } // End of texture.
  36.  
  37. //------------------------------------------------------------------->
  38. //
  39. // Special plastic oven texture.
  40.  
  41.         #declare T_Oven = texture {
  42.  
  43.                 finish {
  44.                         ambient 0.10
  45.                         diffuse 0.90
  46.                         phong 1.00
  47.                         phong_size 35.0
  48.                         } // End of finish.
  49.  
  50.                 pigment { rgb < 0.75, 0.75, 0.45 > }
  51.  
  52.         } // End of texture.
  53.  
  54. //------------------------------------------------------------------->
  55. //
  56. // Well, go ahead and make something.
  57.  
  58.         #declare Oven = union {
  59.  
  60.         // Floor base.
  61.                 box { < -11.5, 0, -5.5 > < 11.5, 1, 5.5 >
  62.                         //texture { T_Oven } }
  63.                         pigment { Gray70 } }
  64.  
  65.         // Lower left side, with two doors.
  66.                 box { < -12, 1, -6, > < 0, 12, 6 > texture { T_Oven } }
  67.                 box { < -12, 1, -6, > < -6.1, 12, -6.1 > texture { T_Oven } }
  68.                 box { < -5.9, 1, -6, > < 0, 12, -6.1 > texture { T_Oven } }
  69.  
  70.         // Tiny door handles.
  71.                 box { < -5.8, 6, -6.1, > < -5.5, 8, -6.2 > pigment{Black} }
  72.                 box { < -6.2, 6, -6.1, > < -6.5, 8, -6.2 > pigment{Black} }
  73.  
  74.         // Middle left tunnel.
  75.  
  76.                 box { < -12.5, 12, -6.5, > < 0, 15, 6.5 >texture { T_Oven } }
  77.  
  78.         // Nameplate.
  79.  
  80.                 box { < 0, 0, 0 > < 1, 1, 0.1 >
  81.                         pigment {
  82.                         image_map { gif "sticker.gif" interpolate 2 transmit 249,1 }
  83.                         } // End of pigment.
  84.  
  85.                         scale < 12.3, 2.8, 1 >
  86.                         translate < -12.4, 12.1, -6.51 >
  87.  
  88.                         } // End of box.
  89.  
  90.         // Upper left side.
  91.                 box { < -12, 15, -6, > < 0, 25, 6 > texture { T_Oven } }
  92.                 // Overhang to make shadow.
  93.                 box { < -12.1, 25, -6.1, > < 0.1, 25.1, 6.1 > texture { T_Oven } }
  94.  
  95.         // Little LED lights on upper left side.
  96.                 #declare X = -11 #while ( X <= -2 )
  97.                 #declare Y =  18 #while ( Y <= 22 )
  98.  
  99.                         box { < X+0.25, Y+0.0, -6 > < X+0.75, Y+0.5, -6.1 >
  100.                                 pigment { Black } }
  101.  
  102.                         #declare TEMP = int(rand(R1)*3)
  103.                         #if(TEMP=0) #declare TEMP_PIG=Yellow #end
  104.                         #if(TEMP=1) #declare TEMP_PIG=Green  #end
  105.                         #if(TEMP=2) #declare TEMP_PIG=Red    #end
  106.  
  107.                         box { < X+0.35, Y+0.1, -6 > < X+0.65, Y+0.4, -6.2 >
  108.                                 pigment{TEMP_PIG} }
  109.  
  110.                 #declare Y = Y + 1 #end
  111.                 #declare X = X + 1 #end
  112.  
  113.         // Top handle on left side.
  114.                 box { < -10, 27, -1, > < -2, 28, 1 > texture { T_Oven } }
  115.                 box { < -10, 25, -1, > < -9, 27, 1 > texture { T_Oven } }
  116.                 box { <  -3, 25, -1, > < -2, 27, 1 > texture { T_Oven } }
  117.  
  118.         // Lower right side (open).
  119.                 // Back.
  120.                 box { < 0, 1, 5.9, > < 12, 12, 6 > texture { T_Oven } }
  121.                 // Right.
  122.                 box { < 11.9, 1, -6, > < 12, 12, 6 > texture { T_Oven } }
  123.                 // Floor.
  124.                 box { < 0, 1, -6, > < 11.9, 1.1, 5.9 > texture { T_Oven } }
  125.  
  126.         // Stuff on floor of lower right side.
  127.  
  128.                 // Circuit board.
  129.                 box { < 0.5, 1.4, -5.5, > < 11, 1.5, 4.5 >
  130.                         pigment { SpringGreen } }
  131.  
  132.                 #declare X = 1 #while ( X <= 9 )
  133.                 #declare Z = -5 #while ( Z <= 3 )
  134.  
  135.                         // Chip.
  136.                         box { < X, 1.7, Z > < X+1.5, 2.0, Z+1 >
  137.                                 pigment { Black } }
  138.  
  139.                         // Legs.
  140.                         box { < X+0.1, 1.5, Z-0.1 >< X+1.4, 1.9, Z+0.1 >
  141.                                 pigment{checker Silver,Black
  142.                                 scale < 0.1, 10, 10 > } }
  143.  
  144.                 #declare Z = Z + 2 #end
  145.                 #declare X = X + 2 #end
  146.  
  147.         // Right side tunnel.
  148.                 difference {
  149.                         box { <  0.0, 12.0, -6.5, > < 12.5, 15.0, 6.5 > }
  150.                         box { < -0.1, 12.2, -6.3, > < 12.6, 14.8, 6.3 > }
  151.                         texture { T_Oven }
  152.                 } // End of difference.
  153.  
  154.         // Burners.
  155.                 #declare X = 3.5 #while ( X <= 8.5 )
  156.                 #declare Z = -3 #while ( Z <= 3 )
  157.  
  158.                 // Hot part.
  159.                 cylinder { < 0, 0, 0 > < 0, 0.2, 0 >, 2
  160.                         texture { T_Spiral_Burner }
  161.                         translate < X, 15, Z > }
  162.  
  163.                 // Chrome trim.
  164.                 cylinder { < 0, 0, 0 > < 0, 0.1, 0 >, 2.3
  165.                         texture { T_Silver_5A }
  166.                         translate < X, 15, Z > }
  167.  
  168.                 #declare Z = Z + 6 #end
  169.                 #declare X = X + 5 #end
  170.  
  171.         // Knobs.
  172.                 // Outer black edge.
  173.                 cylinder { <3.5,13.5,-6.5><3.5,13.5,-6.55>,1.05 pigment{Black} }
  174.                 cylinder { <8.5,13.5,-6.5><8.5,13.5,-6.55>,1.05 pigment{Black} }
  175.  
  176.                 // Big chrome.
  177.                 cone { <3.5,13.5,-6.5>,1 <3.5,13.5,-6.7>,0.7 texture{T_Silver_5A} }
  178.                 cone { <8.5,13.5,-6.5>,1 <8.5,13.5,-6.7>,0.7 texture{T_Silver_5A} }
  179.  
  180.                 // Center black part.
  181.                 cone { <3.5,13.5,-6.5>,0.4 <3.5,13.5,-7>,0.3 pigment{Gray30} }
  182.                 cone { <8.5,13.5,-6.5>,0.4 <8.5,13.5,-7>,0.3 pigment{Gray30} }
  183.  
  184.  
  185.  
  186.         } // End of union.
  187.  
  188. //------------------------------------------------------------------->
  189. //
  190. // End of this file.
  191.  
  192.